package com.aaa.fpa.controller;

import com.aaa.fpa.service.ResultService;
import com.aaa.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController

@RequestMapping("/result")

public class ResultController {
    @Autowired
    private ResultService resultService;
    @RequestMapping("/findAllrt")
    public ResultBean findAllrt(Page page, Result result){

        return  resultService.findAllrt(page,result);
    }
    @RequestMapping("/deletesrt")
    public  int deletesrt(@RequestParam("tester_id") int[ ] tester_id){

        return  resultService.deletesrt(tester_id);
    }
    @PostMapping("/findAllfpa")
    public  ResultBean findAllfpa() {
        Map<String,Integer>  fpa = resultService.findAllfpa();
        ResultBean resultBean = new ResultBean();

        resultBean.setData(fpa);
        return  resultBean;
    }
    @RequestMapping("/check")
    public  Result check(int tester_id){

        return resultService.check(tester_id);
    }
    @RequestMapping("/checkdiv")
    public Div checkdiv(int id){
        return resultService.checkdiv(id);
    }

}
